// 引入封装的 axios 扩展
import axiosex from "../axiosex";
import type { IPersonInfo } from "@/models/IPersonInfo";
import type { IBaseRequest } from "@/models/IBaseRequest";
import type { IBaseResponse } from "@/models/IBaseResponse";
import type { IBasePagingData } from "@/models/IBasePagingData";
import type { IQueryByIntID } from "@/models/IQueryByIntID";

/**插入人员信息 */
export const PersonInfo_AddData = (data: IPersonInfo) =>
  axiosex.post(
    "/api/PersonInfo/AddData",
    data
  ) as unknown as IBaseResponse<IPersonInfo>;
/**删除人员信息 */
export const PersonInfo_DeleteData = (data: IQueryByIntID) =>
  axiosex.delete("/api/PersonInfo/DeleteData", {
    params: data,
  }) as unknown as IBaseResponse<Number>;

/**更新人员信息 */
export const PersonInfo_UpdateData = (data: IPersonInfo) =>
  axiosex.put(
    "/api/PersonInfo/UpdateData",
    data
  ) as unknown as IBaseResponse<Number>;
/**根据主键查询人员信息 */
export const PersonInfo_GetData = (data: IQueryByIntID) =>
  axiosex.get("/api/PersonInfo/GetData", {
    params: data,
  }) as unknown as IBaseResponse<IPersonInfo>;
/**分页查询人员信息 */
export const PersonInfo_GetPageData = (data: IBaseRequest<IPersonInfo>) =>
  axiosex.post("/api/PersonInfo/GetPageData", data) as unknown as IBaseResponse<
    IBasePagingData<IPersonInfo>
  >;